package com.project.mapper.CgwMapper;

import com.Entity.DzmHisMemberEntity;
import org.apache.ibatis.jdbc.SQL;
public class OrderProvider {//拼装sql
    public String queryOrderByParam(DzmHisMemberEntity param) {
        String TBL_ORDER = null;
        Byte bye = param.getType();
        String type=String.valueOf(bye);
        if (type.equals("1")){
           TBL_ORDER = "dzm_his_doctor a,dzm_his_member b,dzm_his_department c";
            SQL sql = new SQL().SELECT("*").FROM(TBL_ORDER);
                sql.WHERE("a.uid=b.uid AND c.did=b.p_id");
            System.out.println(sql.toString());
            return sql.toString();
        }else{
            TBL_ORDER="dzm_his_member";
            SQL sql = new SQL().SELECT("*").FROM(TBL_ORDER);
            int room = param.getUid();
                String uid = String.valueOf(room);
                sql.WHERE("uid= #{uid}");
            System.out.println(sql.toString());
            return sql.toString();
        }
    }




}